<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">


<ui:composition template="IndexAdmin.xhtml">
	<ui:define name="conteudo">
		<h:form>
			<f:loadBundle basename="br.ucb.jogo.recursos.messages" var="msg" />
			<center>
				<p:panel header="#{msg.CADASTRO_DE_TREINOS}">
					<p:panelGrid columns="3" id="painelCadastroTreino" style="width:500px">
						<h:outputLabel value="#{msg.NOME}: "/>
						<p:inputText id="nome" required="true" value="#{treinoManagedBean.treino.nome}" style="width:500px">
							<f:validateLength  minimum="0" maximum="35"/> 
						</p:inputText>
						<h:message for="nome" showSummary="true" showDetail="false" errorStyle="color:red"/>
						
						<h:outputLabel value="#{msg.PONTOS}: "/>
						<p:inputText id="pontos" required="true" value="#{treinoManagedBean.treino.pontos}" style="width:500px">
							<f:validateLongRange  minimum="0"/> 
						</p:inputText>
						<h:message for="pontos" showSummary="true" showDetail="false" errorStyle="color:red"/>
						
						<h:outputLabel value="#{msg.TEMPO_NECESSARIO}: "/>
						<p:inputText id="tempoNecessario" required="true" value="#{treinoManagedBean.treino.tempoNecessario}" style="width:500px">
							<f:validateLongRange  minimum="1"/> 
						</p:inputText>
						<h:message for="tempolNecessario" showSummary="true" showDetail="false" errorStyle="color:red"/>
						
						<h:outputLabel value="#{msg.CASH}: "/>
						<p:inputText id="cash" required="true" value="#{treinoManagedBean.treino.cash}" style="width:500px">
							<f:validateDoubleRange  minimum="0"/> 
						</p:inputText>
						<h:message for="cash" showSummary="true" showDetail="false" errorStyle="color:red"/>
					</p:panelGrid>
					<p:commandButton value="#{msg.ENVIAR}" action="#{treinoManagedBean.save}" ajax="false"/>	 
				</p:panel>	
			</center>
		</h:form>
	</ui:define>
</ui:composition>
</html>